﻿
/////////////////////////////////////////////////////////////////
//File: BlogDao.cs
//Description: 
//Copyright© 2011 Moliu
//History:
//  2012/5/20 23:36:41    moliu    
/////////////////////////////////////////////////////////////////
using MAF.CRUD;
using My.Blog.Domain.Entities;

namespace My.Blog.Database.Persistence
{
    public partial class BlogDao : DatabaseCRUD<Article>
    {
        protected override string _MapAdd { get { return "Blog.Add"; } }
        protected override string _MapUpdate { get { return "Blog.Update"; } }
        protected override string _MapDelete { get { return "Blog.Delete"; } }
        protected override string _MapSearch { get { return "Blog.Search"; } }
        protected override string _MapCount { get { return "Blog.Count"; } }
       
        // 构造函数
        public BlogDao( string configFile,string tableName ) : base(configFile,tableName){}
        
        protected string _UpdateNameSqlKey = "Blogs.UpdateBlogName";
        protected string _UpdateIntroductionSqlKey = "Blogs.UpdateBlogIntroduction";
        protected string _UpdateDeclarationSqlKey = "Blogs.UpdateBlogDeclaration";
        protected string _UpdatePasswordSqlKey = "Blogs.UpdateBlogPassword";

        public int UpdateBlogName(BlogInfo content)
        {
            return map.Update(_UpdateNameSqlKey, content);
        }

        public int UpdateBlogIntroduction(BlogInfo content)
        {
            return map.Update(_UpdateIntroductionSqlKey, content);
        }

        public int UpdateBlogDeclaration(BlogInfo content)
        {
            return map.Update(_UpdateDeclarationSqlKey, content);
        }

        public int UpdateBlogPassword(BlogInfo content)
        {

            return map.Update(_UpdatePasswordSqlKey, content);
        }
    }
}
    